package com.itheima.pojo;

import com.itheima.service.UserService;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

/**
 * @author wz
 * @description:
 * @date 2021-10-31
 */
public class TestBeanFactory {
    public static void main(String[] args) {
        ClassPathResource resource = new ClassPathResource("applicationContext.xml");
        XmlBeanFactory beanFactory = new XmlBeanFactory(resource);
        UserService userService = (UserService) beanFactory.getBean("userService1");
        userService.add();
    }
}
